home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / XIRCOM / CEA / OEMSETUP.INF < prev    next >
INI File  |  1996-07-31  |  45KB  |  1,527 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Xircom CE/A, CE-10 CreditCard Adapter Setup for NT 4.0
  6. ;
  7. ;*******************************************************************************
  8.                                      
  9. ;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS "message"
  10.  
  11. [Identification]
  12.     OptionType = NetAdapter
  13.  
  14. [PlatformsSupported]
  15.     ISA
  16.     EISA
  17.     MCA
  18.  
  19. [Options]
  20.     CENDIS3
  21.  
  22. [OptionsTextENG]
  23.     CENDIS3     = "Xircom CreditCard Ethernet"
  24.  
  25.  
  26.  
  27. [AllFileConstants]
  28. GenericInfVersion  = " v1.18"
  29. ;  File names, etc. ----------------------------------------
  30. UtilityInf      = "UTILITY.INF"
  31. ParamInf        = "NCPARAM.INF"
  32. subroutineinf   = "SUBROUTN.INF"
  33. SoftwareType    = "driver"
  34. Exit_Code       = 0
  35. ; EventLog Message File  ----------------------------------------
  36. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  37. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  38. ; Product Info ----------------------------------------
  39. Manufacturer    = "Xircom"
  40.  
  41.  
  42.  
  43. ;There is one FileConstants section for each adapter supported in the [Options] section
  44.  
  45. [FileConstants-CENDIS3]
  46. GenericAdapterName = "Xircom CreditCard Ethernet"
  47. GenericDriverName  = "Xircom CreditCard Ethernet Driver"
  48. GenericSysName     = "CENDIS3.sys"
  49. GenericName        = "CENDIS3"
  50. ; Product Info ----------------------------------------
  51. ProductMajorVersion     = "1"
  52. ProductMinorVersion     = "10"
  53. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  54. ; Software  ----------------------------------------
  55. ProductSoftwareName     = "CENDIS3"
  56. ProductSoftwareDescription = "Xircom CreditCard Ethernet Driver"
  57. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\"$(GenericSysName)
  58. NetRuleSoftwareType     = "cendis3Sys ndisDriver cendis3Driver"
  59. NetRuleSoftwareUse      = $(SoftwareType)
  60. NetRuleSoftwareBindForm = """cendis3Sys"" yes no container"
  61. NetRuleSoftwareClass    = {"cendis3Driver basic"}
  62. NetRuleSoftwareBindable = {"cendis3Driver cendis3Adapter non exclusive 100"}
  63. ; Hardware  ----------------------------------------
  64. ProductHardwareName        = "CENDIS3"
  65. ProductHardwareDescription = "Xircom CreditCard Ethernet"
  66. NetRuleHardwareType        = "cendis3 cendis3Adapter"
  67. NetRuleHardwareBindForm    = " yes yes container"
  68. NetRuleHardwareClass       = {"cendis3Adapter basic"}
  69. ; Registry Key  ----------------------------------------
  70. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  71. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  72. ; Tuple Information -----------------------------------
  73. VERS1Manufacturer = "Xircom"
  74. VERS1Product      = "CreditCard 10Base-T"
  75. VERS1Type                 = "CE-10/A"
  76.  
  77.  
  78. [GeneralConstants]
  79. ;  Program flow control variables.
  80. from      = ""
  81. to        = ""
  82. ;  Return codes; Exit_Code is set to one of these
  83. ExitCodeOk     = 0
  84. ExitCodeCancel = 1
  85. ExitCodeFatal  = 2
  86. KeyNull         = ""
  87. MAXIMUM_ALLOWED   = 33554432
  88. RegistryErrorIndex = NO_ERROR
  89. KeyProduct      = ""
  90. KeyParameters   = ""
  91. TRUE            = 1
  92. FALSE           = 0
  93. NoTitle            = 0
  94. ExitState   = "Active"
  95. OldVersionExisted = $(FALSE)
  96. DriverPath      = $(!STF_NTPATH)\drivers
  97.  
  98.  
  99.  
  100.  
  101. [date]
  102.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  103.     ; Minute, Second }
  104.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  105.  
  106.  
  107. ;---------------------------------------------------------------------------
  108. ; 1. Identify
  109. ;
  110. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  111. ;                as we are choosing currently.
  112. ;
  113. ; INPUT:         None
  114. ;
  115. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  116. ;                $($R1): Option Type (COMPUTER ...)
  117. ;                $($R2): Diskette description
  118. ;---------------------------------------------------------------------------
  119.  
  120. [Identify]
  121.     ;
  122.     ;
  123.     read-syms Identification
  124.     
  125.     set Status     = STATUS_SUCCESSFUL
  126.     set Identifier = $(OptionType)
  127.     set Media      = #("Source Media Descriptions", 1, 1)
  128.  
  129.     Return $(Status) $(Identifier) $(Media)
  130.  
  131. ;------------------------------------------------------------------------
  132. ; 2. ReturnOptions:
  133. ;
  134. ; DESCRIPTION:   To return the option list supported by this INF and the
  135. ;                localised text list representing the options.
  136. ;
  137. ;
  138. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  139. ;
  140. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  141. ;                                STATUS_NOLANGUAGE
  142. ;                                STATUS_FAILED
  143. ;                                STATUS_NOTSUPPORTED
  144. ;
  145. ;                $($R1): Option List
  146. ;                $($R2): Option Text List
  147. ;------------------------------------------------------------------------
  148.  
  149. [ReturnOptions]
  150.     ;
  151.     ;
  152.     set Status        = STATUS_FAILED
  153.     set OptionList     = {}
  154.     set OptionTextList = {}
  155.  
  156.     ;
  157.     ; Check if the language requested is supported
  158.     ;
  159.     set LanguageList = ^(LanguagesSupported, 1)
  160.     Ifcontains(i) $($0) in $(LanguageList)
  161.     ;
  162.     ; Check if the platforms requested is supported
  163.     ;
  164.     ifstr(i) $($1) == ""
  165.             goto returnoptions
  166.     endif
  167.  
  168.     set PlatformList = ^(PlatformsSupported, 1)
  169.     Ifcontains(i) $($1) in $(PlatformList)
  170.             goto returnoptions
  171.     else
  172.             set Status = STATUS_NOTSUPPORTED
  173.             goto finish_ReturnOptions
  174.     endif
  175.     else
  176.         set Status = STATUS_NOLANGUAGE
  177.         goto finish_ReturnOptions
  178.     endif
  179.  
  180.     ;
  181.     ; form a list of all the options and another of the text representing
  182.     ;
  183.  
  184. returnoptions = +
  185.     set OptionList     = ^(Options, 1)
  186.     set OptionTextList = ^(OptionsText$($0), 1)
  187.     set Status         = STATUS_SUCCESSFUL
  188.  
  189. finish_ReturnOptions = +
  190.     Return $(Status) $(OptionList) $(OptionTextList)
  191.  
  192. ;------------------------------------------------------------------------
  193. ;
  194. ; InstallOption:
  195. ;
  196. ;      This section is shelled to by main installation processing
  197. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  198. ;
  199. ;
  200. ; FUNCTION:  To copy files representing Options
  201. ;            To configure the installed option
  202. ;            To update the registry for the installed option
  203. ;
  204. ; INPUT:     $($0):  Language to use
  205. ;            $($1):  OptionID to install
  206. ;            $($2):  SourceDirectory
  207. ;            $($3):  AddCopy  (YES | NO)
  208. ;            $($4):  DoCopy   (YES | NO)
  209. ;            $($5):  DoConfig (YES | NO)
  210. ;
  211. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  212. ;                            STATUS_NOLANGUAGE |
  213. ;                            STATUS_USERCANCEL |
  214. ;                            STATUS_FAILED
  215. ;
  216. ;------------------------------------------------------------------------
  217. [InstallOption]
  218.     ;
  219.     ; Set default values for
  220.     ;
  221.     set Status   = STATUS_FAILED
  222.     ;
  223.     ; extract parameters
  224.     ;
  225.     set Option   = $($1)
  226.     set SrcDir   = $($2)
  227.     set AddCopy  = $($3)
  228.     set DoCopy   = $($4)
  229.     set DoConfig = $($5)
  230.  
  231.     Set !DebugOutputControl = 1
  232.  
  233.     ;
  234.     ; Check if the language requested is supported
  235.     ;
  236.     set LanguageList = ^(LanguagesSupported, 1)
  237.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  238.     Return STATUS_NOLANGUAGE
  239.     endif
  240.  
  241.     set-subst LF = "\n"
  242.  
  243.     read-syms GeneralConstants
  244.     read-syms AllFileConstants
  245.     read-syms FileConstants"-"$(Option)
  246.     read-syms DialogConstants$(!STF_LANGUAGE)"-"$(Option)
  247.     ifstr(i) $(!NTN_Origination) == "NCPA"
  248.     set Continue = $(OK)
  249.     endif
  250.  
  251.     read-syms AllFileConstants$(!STF_LANGUAGE)
  252.     read-syms FileConstants$(!STF_LANGUAGE)"-"$(Option)
  253.  
  254.     detect date
  255.  
  256.     set-title  $(FunctionTitle)
  257.  
  258.     set to   = Begin
  259.     set from = Begin
  260. ;
  261. ;  Assume all is well.
  262. ;
  263.     set CommonStatus = STATUS_SUCCESSFUL
  264.  
  265.     EndWait
  266.  
  267. ;
  268. ;   Set up the operation-mode-based variables and gaily welcome
  269. ;   the user.  If the "install mode" variable is improperly set,
  270. ;   assume this is a new installation.
  271. ;
  272.  
  273. Begin = +
  274.     Set ActivateDetection = FALSE
  275.  
  276.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  277.     set StartLabel = removeadapter
  278.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  279.     set StartLabel = UpgradeSoftware
  280.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  281.     set StartLabel = bindingadapter
  282.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  283. ;        set ActivateDetection = TRUE
  284.     set StartLabel = configureadapter
  285.     ;
  286.     ;   You cannot config the software component
  287.     ;
  288.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  289.         Debug-Output "Cannot configure the CE/A server software."
  290.         Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  291.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  292.         Debug-Output "ShellCode error: cannot get an error string."
  293.         goto ShellCodeError
  294.         endif
  295.         set Error = $($R0)
  296.         set from = end
  297.         set to = end
  298.         goto nonfatalinfo
  299.     endif
  300.     else
  301. ;        set ActivateDetection = TRUE
  302.     set StartLabel = installadapter
  303.     set OEM_ABANDON_OPTIONS = {}
  304.     set OEM_ABANDON_SOFTWARE = FALSE
  305.     set OEM_ABANDON_ON = TRUE
  306.     endif
  307.  
  308.  
  309.     ;  set the [Default values]
  310.  
  311.     set IRQValue = *($(IRQList), 3)                                      ; IRQ Level      = 10
  312.     set IOBaseAddrValue = *($(IOBaseAddrList), 16)       ; IOBase Address = 0x300
  313.     set MemoryAddrValue = *($(MemoryAddrList), 49)       ; Memory Address =     0xD0000
  314.     set TransceiverValue = *($(TransceiverList), 1)      ; Transceiver    = ThinNet
  315.                                               
  316.     Set from = $(fatal)
  317.     Set to = $(fatal)
  318.     Goto $(StartLabel)
  319.  
  320. ;-----------------------------------------------
  321. ; Installation Section
  322. ;-----------------------------------------------
  323.  
  324. installadapter = +
  325. ;
  326. ;   First, check whether the same version of the software exists
  327. ;
  328.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  329.  
  330.     Ifstr $(KeyProduct) != $(KeyNull)
  331.     ;
  332.     ; Same version already existed in the local machine
  333.     ; Popup the dialog and ask the user whether he wants to continue
  334.     ;
  335.     CloseRegKey $(KeyProduct)
  336.  
  337.     ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  338.        ;
  339.        ; Cannot Install the same software again
  340.        ;
  341.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  342.            $(ProductVersion)
  343.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  344.            Debug-Output "ShellCode error: cannot get an error string."
  345.            goto ShellCodeError
  346.        endif
  347.  
  348.        goto end
  349.     else
  350.        ;
  351.        ; Add a new adapter card?
  352.        ;
  353.        Shell $(UtilityInf), CardExistedDlg
  354.  
  355.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  356.            Debug-Output "ShellCode error: cannot get an error string."
  357.            goto ShellCodeError
  358.        endif
  359.  
  360.        ifstr(i) $($R1) != "OK"
  361.            goto end
  362.        endif
  363.        set OldVersionExisted = $(TRUE)
  364.     endif
  365.     endif
  366.  
  367. ;
  368. ;  dll load addition
  369. ;
  370.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  371.  
  372.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  373.     Goto ShellCodeError
  374.     Else-Ifstr(i) $($R0) == STATUS_FAILED
  375.     Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  376.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  377.         goto ShellCodeError
  378.     endif
  379.     set Error = $($R0)
  380.     Goto fatal
  381.     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  382.     Goto successful
  383.     Endif
  384.  
  385.     Set SrcDir = $($R1)
  386.  
  387.     install "Install-Dll"
  388.  
  389.     goto adaptersetup
  390.  
  391. ;-----------------------------------------------
  392. ; Configuration Section
  393. ;-----------------------------------------------
  394. ;
  395. ;   Get the current values of all the parameters
  396. ;
  397. configureadapter = +
  398.     Ifstr $(KeyProduct) == $(KeyNull)
  399.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  400.     Ifstr $(KeyProduct) == $(KeyNull)
  401.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  402.         Debug-Output "Cannot find component product key"
  403.         goto fatalregistry
  404.     Endif
  405.     Endif
  406.  
  407.     ;
  408.     ; Get the other parameters;  they're attached to the service parameters key
  409.     ;
  410.     Debug-Output "INF: Shelling to FindService"
  411.     Shell $(UtilityInf) FindService, $(KeyProduct)
  412.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  413.     Debug-Output "INF: FindService shell failure"
  414.     Goto ShellCodeError
  415.     Endif
  416.     Ifstr(i) $($R0) != NO_ERROR
  417.     Debug-Output "INF: FindService Shell error: "$($R0)
  418.     Goto fatalregistry
  419.     endif
  420.  
  421.     Set KeyParameters = $($R2)
  422.  
  423.     ;
  424.     ;  We don't need the services key, so close it.
  425.     ;
  426.     CloseRegKey $($R1)
  427.  
  428.     Ifstr $(KeyParameters) == $(KeyNull)
  429.     set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  430.     Debug-Output "Cannot find component service"
  431.     goto fatalregistry
  432.     endif
  433.  
  434.     set OldVersionExisted = $(TRUE)
  435.  
  436.     set ValueName = ""
  437.     set ValueData = ""
  438.     set ValueStr  = ""
  439.     set ValueList = {}
  440.  
  441.  
  442.     ;
  443.     ; Get the old values from the Registry      [Get Values]
  444.     ; *********************************************************
  445.     EnumRegValue $(KeyParameters) ValueList
  446.  
  447.     ForListDo $(ValueList)
  448.         set ValueItem = $($)
  449.         set ValueName = *($(ValueItem),1)
  450.         set ValueData = *($(ValueItem),4)
  451.         ifstr(i) $(ValueName) == "Transceiver"
  452.             set TransceiverIndex = $(ValueData)
  453.         else-ifstr(i) $(ValueName) == "IoBaseAddress"   
  454.             set IOBaseAddrIndex = $(ValueData)
  455.         else-ifstr(i) $(ValueName) == "InterruptNumber"
  456.             set IRQValueIndex = $(ValueData)
  457.         else-ifstr(i) $(ValueName) == "PCCARDAttributeMemoryAddress"
  458.             set MemoryAddrIndex = $(ValueData)
  459.         endif
  460.     EndForListDo
  461.  
  462.     set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  463.     ifstr(i) $(IRQValue) == ""
  464.         set IRQValue = *($(IRQList), 2)
  465.     endif
  466.  
  467.     set MemoryAddrValue = *($(MemoryAddrList), ~($(MemoryAddrValues),$(MemoryAddrIndex)))
  468.     ifstr(i) $(MemoryAddrValue) == ""
  469.         set MemoryAddrValue = *($(MemoryAddrValues), 2)
  470.     endif
  471.  
  472.     set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  473.     ifstr(i) $(IOBaseAddrValue) == ""
  474.         set IOBaseAddrValue = *($(IOBaseAddrList), 1)     
  475.     endif
  476.  
  477.     set TransceiverValue = *($(TransceiverList), ~($(TransceiverValues),$(TransceiverIndex)))
  478.     ifstr(i) $(TransceiverValue) == ""
  479.         set TransceiverValue = *($(TransceiverValues), 2)
  480.     endif
  481.  
  482.  
  483.  
  484.     ;  Save the settings as they were read from the Registry.
  485.  
  486. ;    Shell $(ParamInf) Param_SaveValues
  487. ;    Set CurrParamSettings = $($R0)
  488. ;
  489. ;   Put up the adapter configuration dialog if necessary.
  490. ;
  491. ;   Note that $(CurrParamSettings) has the old known parameter values.
  492. ;
  493. adaptersetup = +
  494.  
  495.  
  496.     ;Shell "" DebugConfiguration "before displaying dialog"
  497.  
  498.     Set from = adapteroptions
  499.  
  500.  
  501. adapteroptions = +
  502.  
  503.     LoadLibrary "disk 1" $(DialogDllName) hLib
  504.     read-syms FileDependentDlg$(!STF_LANGUAGE)"-"$(Option)                
  505.     ui start "InputDlg"  $(hLib)
  506.     set ExitButton      = $(ButtonPressed)
  507.     ;Debug-Output " ButtonPressed "$(ButtonPressed)
  508.     ;Debug-Output " DLGEVENT "$(DLGEVENT)
  509.     FreeLibrary $(hLib)
  510.     
  511.          
  512.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  513.      
  514.         set IOBaseAddrIndex  = $(Combo1Out)
  515.         set MemoryAddrIndex  = $(Combo2Out)
  516.         set IRQValueIndex    = $(Combo3Out)
  517.         set TransceiverIndex = $(Combo4Out)
  518.         set ExitButton       = $(ButtonPressed)
  519.         ui pop 1
  520.         ;goto nextstep
  521.  
  522.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  523.         set CommonStatus = STATUS_USERCANCEL
  524.         ui pop 1
  525.         goto end
  526.     else
  527.         set CommonStatus = STATUS_USERCANCEL
  528.         ui pop 1
  529.         Debug-Output "Action: unknown. Bye."
  530.         goto end
  531.     endif
  532.  
  533.  
  534.  
  535. ;
  536. ;   If installing, go create the necessary keys;
  537. ;   if configuring, they're already open.
  538. ;
  539. skipoptions =+
  540.  
  541.     ifint $(OldVersionExisted) == $(TRUE)
  542.     ifstr(i) $(!NTN_InstallMode) == configure
  543.         goto writeparameters
  544.     endif
  545.     endif
  546.     StartWait
  547.     ;
  548.     ; Add Software Component
  549.     ;
  550.     ifint $(OldVersionExisted) == $(FALSE)
  551.  
  552.     ifstr(i) $(!NTN_InstallMode) == "install"
  553.        Ifstr(i) $(DoCopy) == "YES"
  554.  
  555.           Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  556.  
  557.           Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  558.           Goto ShellCodeError
  559.           Else-Ifstr(i) $($R0) == STATUS_FAILED
  560.           Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  561.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  562.               goto ShellCodeError
  563.           endif
  564.           set Error = $($R0)
  565.           Goto fatal
  566.           Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  567.           Goto successful
  568.           Endif
  569.  
  570.           Set SrcDir = $($R1)
  571.  
  572.        Endif
  573.  
  574.        install "Install-Option"
  575.  
  576.        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  577.           Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  578.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  579.           goto ShellCodeError
  580.           endif
  581.           set Error = $($R0)
  582.           goto fatal
  583.        endif
  584.     endif
  585.  
  586.  
  587.  
  588.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  589.         $(ProductSoftwareName), +
  590.         $(ProductSoftwareName), +
  591.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  592.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  593.         $(NetEventDLL)
  594.  
  595.     Set OEM_ABANDON_SOFTWARE = TRUE
  596.  
  597.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  598.         Debug-Output "ShellCode error"
  599.         goto ShellCodeError
  600.     endif
  601.     ;
  602.     ;   At this point:
  603.     ;     $R1 contains the product version key handle;
  604.     ;     $R2 contains the NetRules subkey handle;
  605.     ;     $R3 contains the new Services key handle; and
  606.     ;     $R4 contains the Parameters key
  607.     ;     $R5 contains the Linkage Key
  608.     ;
  609.     set RegistryErrorIndex = $($R0)
  610.     set KeyProduct      = $($R1)
  611.     Set SoftNetRulesKey = $($R2)
  612.     CloseRegKey $($R3)
  613.     CloseRegKey $($R4)
  614.     CloseRegKey $($R5)
  615.  
  616.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  617.         EndWait
  618.         Debug-Output "Registry error: add software components"
  619.         CloseRegKey $(KeyProduct)
  620.         CloseRegKey $(SoftNetRulesKey)
  621.         goto fatalregistry
  622.     endif
  623.  
  624.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  625.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  626.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  627.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  628.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  629.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  630.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  631.  
  632.     Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  633.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  634.         Debug-Output "ShellCode error."
  635.         goto ShellCodeError
  636.     endif
  637.  
  638.     set RegistryErrorIndex = $($R0)
  639.  
  640.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  641.         EndWait
  642.         Debug-Output "Registry error: add value list."
  643.         CloseRegKey $(KeyProduct)
  644.         CloseRegKey $(SoftNetRulesKey)
  645.         goto fatalregistry
  646.     endif
  647.  
  648.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  649.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  650.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  651.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  652.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  653.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  654.  
  655.     Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  656.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  657.         Debug-Output "ShellCode error."
  658.         goto ShellCodeError
  659.     endif
  660.  
  661.     set RegistryErrorIndex = $($R0)
  662.  
  663.     CloseRegKey $(KeyProduct)
  664.     CloseRegKey $(SoftNetRulesKey)
  665.  
  666.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  667.         EndWait
  668.         Debug-Output "Resgitry error: add value list."
  669.         goto fatalregistry
  670.     endif
  671.     endif
  672. ;
  673. ;   Create the HARDWARE\Netcard region and its corresponding service
  674. ;
  675.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  676.  
  677.     ifint $($R4) != -1
  678.     Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  679.     endif
  680.  
  681.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  682.     Debug-Output "Cannot add hardware component"
  683.     goto ShellCodeError
  684.     endif
  685.  
  686.     set RegistryErrorIndex = $($R0)
  687.  
  688.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  689.     EndWait
  690.     Debug-Output "Registry error: add hardware component"
  691.     CloseRegKey $($R1)
  692.     CloseRegKey $($R2)
  693.     CloseRegKey $($R3)
  694.     goto fatalregistry
  695.     endif
  696.  
  697. ;
  698. ;   At this point:
  699. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  700. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  701. ;     $R3  Registry key handle for <service>\Parameters key
  702. ;     $R4  Adapter number assigned to adapter
  703. ;     $R5  Service name generated by combining svc name with adapter number
  704. ;
  705.     set KeyParameters = $($R3)
  706.     set KeyAdapterRules = $($R2)
  707.     set AdapterNumber = $($R4)
  708.  
  709.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  710.                {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  711.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  712.                {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  713.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  714.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  715.  
  716.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  717.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  718.     Debug-Output "ShellCode error"
  719.     goto ShellCodeError
  720.     endif
  721.  
  722.     CloseRegKey $($R1)
  723.  
  724.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  725.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  726.  
  727.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  728.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  729.             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  730.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  731.  
  732.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  733.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  734.     Debug-Output "ShellCode error."
  735.     goto ShellCodeError
  736.     endif
  737.  
  738.     set RegistryErrorIndex = $($R0)
  739.  
  740.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  741.     EndWait
  742.     Debug-Output "Resgitry error: add value list."
  743.     CloseRegKey $(KeyParameters)
  744.     CloseRegKey $(KeyAdapterRules)
  745.     goto fatalregistry
  746.     endif
  747.  
  748.     CloseRegKey $(KeyAdapterRules)
  749.  
  750.     goto writeparameters
  751. ;
  752. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  753. ;
  754. writeparameters = +
  755.     Shell $(UtilityInf), GetBusTypeNum
  756.     set BusTypeNum = $($R1)
  757.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  758.     Debug-Output "ShellCode error."
  759.     goto ShellCodeError
  760.     endif
  761. ;
  762. ;   Add the rest of the parameters to the Services area
  763. ;
  764.  
  765.     
  766.  
  767.     set MemoryAddrValue  = *($(MemoryAddrValues),  ~($(MemoryAddrList), $(MemoryAddrIndex)))    
  768.     set IRQValue         = *($(IRQValues),         ~($(IRQList),        $(IRQValueIndex)))
  769.     set IOBaseAddrValue  = *($(IOBaseAddrValues),  ~($(IOBaseAddrList), $(IOBaseAddrIndex)))         
  770.     set TransceiverValue = *($(TransceiverValues), ~($(TransceiverList),$(TransceiverIndex)))
  771.     set IOLengthValue    = 15       
  772.     set NewValueList     = {{IoBaseAddress,                $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+      
  773.                             {IoLength,                  $(NoTitle),$(!REG_VT_DWORD), $(IOLengthValue)},+
  774.                             {PCCARDAttributeMemoryAddress, $(NoTitle),$(!REG_VT_DWORD),$(MemoryAddrValue)},+
  775.                             {PCCARDAttributeMemorySize, $(NoTitle),$(!REG_VT_DWORD),4096},+
  776.                             {PCCARDAttributeMemoryOffset, $(NoTitle),$(!REG_VT_DWORD),0},+
  777.                             {InterruptNumber,             $(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  778.                             {ResourceManager,           $(NoTitle),$(!REG_VT_SZ),TRUE},+
  779.                             {Transceiver,               $(NoTitle),$(!REG_VT_DWORD),$(TransceiverValue)},+
  780.                             {MediaType,                   $(NoTitle),$(!REG_VT_DWORD),1},+
  781.                             {BusType,                     $(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  782.                             {BusNumber,                   $(NoTitle),$(!REG_VT_DWORD),0},+
  783.                             {ResourceManager,             $(NoTitle),$(!REG_VT_DWORD),1},+
  784.                             {PCMCIA,                      $(NoTitle),$(!REG_VT_DWORD),1},+
  785.                             {PCICBaseAddr,                $(NoTitle),$(!REG_VT_DWORD),992}, +                       ;0x3E0
  786.                             {TCICBaseAddr,                $(NoTitle),$(!REG_VT_DWORD),576}}                         ;0x240
  787.  
  788.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  789.     CloseRegKey $(KeyParameters)
  790.  
  791.     ; --------------------------------------------------------------------------------
  792.     ; Write the parameters to the PCMCIA database section, iff running MS Enabler
  793.     ; Add/replace only the parts for the CE2
  794.     ; --------------------------------------------------------------------------------
  795.     set PCMCIADatabaseKeyName = $(!NTN_ServiceBase)"\Pcmcia\DataBase"
  796.     set PCMCIADatabaseXircomKeyName = $(PCMCIADatabaseKeyName)"\Xircom"
  797. ;    Debug-Output "Opening PCMICA database key "$(PCMCIADatabaseKeyName)
  798.     OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName) $(MAXIMUM_ALLOWED) PCMCIADatabaseKey
  799.  
  800.     ifstr $(PCMCIADatabaseKey) == $(NULL)
  801.         ;Debug-Output "Pcmcia\DataBase not present"
  802.     else ; PCMCIA.sys is installed and registry has database section in it.
  803.         ; Try to open Xircom section.  
  804.         OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName)"\Xircom" $(MAXIMUM_ALLOWED) PCMCIADatabaseXircomKey
  805.         ifstr $(PCMCIADatabaseXircomKey) == $(NULL) ; open failed, so create Xircom subkey
  806.             CreateRegKey $(PCMCIADatabaseKey) {"Xircom", 0, 0} "" $(MAXIMUM_ALLOWED) "" PCMCIADatabaseXircomKey
  807.         endif
  808.  
  809.         ; Open "CreditCard 10Base-T"  aka $(VERS1Product) ----------------------------------------------------------------------
  810.         OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseXircomKeyName)"\"$(VERS1Product) $(MAXIMUM_ALLOWED) PCMCIADatabaseXircomCEAKey
  811.         ifstr $(PCMCIADatabaseXircomCEAKey) == $(NULL)
  812.             CreateRegKey $(PCMCIADatabaseXircomKey) {$(VERS1Product), 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseXircomCEAKey
  813.         endif
  814.  
  815.         ; DON'T Remove previous instances of CEAs -------------------------
  816.         ;DeleteRegTree $(PCMCIADatabaseXircomCEAKey) "B00D"
  817.         ;DeleteRegTree $(PCMCIADatabaseXircomCEAKey) "5FFA"
  818.         ;DeleteRegTree $(PCMCIADatabaseXircomCEAKey) "9C9B"
  819.         ;DeleteRegTree $(PCMCIADatabaseXircomCEAKey) "9FAB"
  820.  
  821.         ; Xircom 10Bt -----------------------
  822.         CreateRegKey $(PCMCIADatabaseXircomCEAKey) {"B00D", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseXircomCEACRCKey
  823.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {Driver, 0, $(!REG_VT_SZ),"cendis3"}
  824.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {AttributeMemorySize, 0, $(!REG_VT_DWORD),4096}
  825.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
  826.         CloseRegKey $(PCMCIADatabaseXircomCEACRCKey)
  827.         ; Xircom 10Bta -----------------------
  828.         CreateRegKey $(PCMCIADatabaseXircomCEAKey) {"5FFA", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseXircomCEACRCKey
  829.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {Driver, 0, $(!REG_VT_SZ),"cendis3"}
  830.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {AttributeMemorySize, 0, $(!REG_VT_DWORD),4096}
  831.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
  832.         CloseRegKey $(PCMCIADatabaseXircomCEACRCKey)
  833.         ; Xircom 10Bta2    -----------------------
  834.         CreateRegKey $(PCMCIADatabaseXircomCEAKey) {"9C9B", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseXircomCEACRCKey
  835.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {Driver, 0, $(!REG_VT_SZ),"cendis3"}
  836.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {AttributeMemorySize, 0, $(!REG_VT_DWORD),4096}
  837.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
  838.         CloseRegKey $(PCMCIADatabaseXircomCEACRCKey)
  839.         ; Xircom Btb -----------------------
  840.         CreateRegKey $(PCMCIADatabaseXircomCEAKey) {"9FAB", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseXircomCEACRCKey
  841.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {Driver, 0, $(!REG_VT_SZ),"cendis3"}
  842.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {AttributeMemorySize, 0, $(!REG_VT_DWORD),4096}
  843.         SetRegValue $(PCMCIADatabaseXircomCEACRCKey) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
  844.         CloseRegKey $(PCMCIADatabaseXircomCEACRCKey)
  845.  
  846.         CloseRegKey  $(PCMCIADatabaseXircomCEAKey)
  847.         CloseRegKey  $(PCMCIADatabaseXircomKey)
  848.         CloseRegKey  $(PCMCIADatabaseKey)
  849.     endif
  850.  
  851.  
  852.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  853.     Debug-Output "ShellCode error."
  854.     goto ShellCodeError
  855.     endif
  856.  
  857.     set RegistryErrorIndex = $($R0)
  858.  
  859.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  860.     Debug-Output "Registry error: Add value list"
  861.     goto fatalregistry
  862.     endif
  863.  
  864.     EndWait
  865.  
  866.     goto successful
  867.  
  868. ;-----------------------------------------------
  869. ; Binding section
  870. ;-----------------------------------------------
  871. bindingadapter =+
  872.     set Error = "Binding: Sorry, not yet implemented."
  873.     goto fatal
  874.  
  875. ;-----------------------------------------------
  876. ; Removeadapter section
  877. ;-----------------------------------------------
  878.  
  879. removeadapter = +
  880.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  881.     ; Remove Software Component
  882.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  883.         $(ProductSoftwareName)
  884.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  885.         Debug-Output "ShellCode error"
  886.         goto ShellCodeError
  887.     endif
  888.  
  889.     set RegistryErrorIndex = $($R0)
  890.  
  891.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  892.         goto fatalregistry
  893.     endif
  894.     else
  895.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  896.         $(ProductSoftwareName), $(!NTN_RegBase)
  897.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  898.         Debug-Output "ShellCode error"
  899.         goto ShellCodeError
  900.     endif
  901.  
  902.     set RegistryErrorIndex = $($R0)
  903.  
  904.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  905.         goto fatalregistry
  906.     endif
  907.     endif
  908.  
  909.     goto end
  910.  
  911. ;-----------------------------------------------
  912. ; Upgrade Software section
  913. ;-----------------------------------------------
  914.  
  915. UpgradeSoftware = +
  916.     ;
  917.     ; First determine whether we want to do upgrade or update for software
  918.     ; or hardware component. Then we will determine whether the Mode is
  919.     ; update or upgrade.
  920.     ;
  921.     ; If the same version of the product existed in the registry, we do
  922.     ; update. Otherwise, we will do a upgrade
  923.     ;
  924.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  925.     ; Upgrade software component
  926.     ;
  927.     ; see whether the same version exist or not
  928.     ;
  929.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  930.  
  931.     Ifstr $(KeyProduct) != $(KeyNull)
  932.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  933.         set Version = *($(VersionInfo), 4)
  934.  
  935.         ;
  936.         ; Update the binaries
  937.         ;
  938.         Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  939.  
  940.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  941.         Debug-Output "ShellCode error"
  942.         goto ShellCodeError
  943.         endif
  944.  
  945.         set !UG_Filename = $($R0)
  946.  
  947.         ifstr(i) $(!UG_Filename) != ""
  948.         install "Install-Update"
  949.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  950.             goto fatal
  951.         endif
  952.         endif
  953.  
  954.         ; Upgrade the version number
  955.         ;
  956.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  957.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  958.  
  959.         ;
  960.         ; do nothing for update
  961.         ;
  962.         ifint $(Version) != $(ProductVersion)
  963.            ;
  964.            ; If the major version number is not the same,
  965.            ; it is major upgrade. So let Upgrade the product
  966.            ;
  967.            ;
  968.            ; make other upgrade change if necessary
  969.            ;
  970.         endif
  971.         CloseRegKey $(KeyProduct)
  972.     else
  973.         ;
  974.         ; Cannot Open software key, goto ERROR
  975.         ;
  976.         goto fatalregistry
  977.     endif
  978.     else
  979.     ;
  980.     ; upgrade/update hardware component
  981.     ; There is no different between upgrade and update for hardware
  982.     ; component
  983.     ;
  984.     ; 1. Get the Service Name
  985.     ; 2. Change the NetRule section if necessary
  986.     ;
  987.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  988.           $(MAXIMUM_ALLOWED) NetworkCardKey
  989.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  990.         ;
  991.         ; Get Service name
  992.         ;
  993.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  994.         set ServiceName = *($(ServiceNameInfo), 4)
  995.  
  996.         ;
  997.         ; Change the NetRule if necessary
  998.         ;
  999.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1000.         $(MAXIMUM_ALLOWED) NetRuleKey
  1001.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1002.         ;
  1003.         ; Make the change....
  1004.         ;
  1005.         else
  1006.         ;
  1007.         ; Error, cannot open net rules key
  1008.         ;
  1009.         goto fatalregistry
  1010.         endif
  1011.  
  1012.         CloseRegKey $(NetRules)
  1013.         CloseRegKey $(NetworkCardKey)
  1014.     else
  1015.         ;
  1016.         ; Error, cannot open network card key
  1017.         ;
  1018.         goto fatalregistry
  1019.     endif
  1020.     ;
  1021.     ; 3. Change the service section of the hardware. i.e.,
  1022.     ;    ParameterName change, value change, etc.
  1023.     ;
  1024.     OpenRegKey $(!REG_H_LOCAL) "" +
  1025.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  1026.           $(MAXIMUM_ALLOWED) ServiceKey
  1027.  
  1028.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  1029.         ;
  1030.         ; Get the ServiceKey to change the Start value
  1031.         ; or Type value. Or open Parameters key to
  1032.         ; change the hardware parameters if necessary.
  1033.         ;
  1034.         CloseRegKey $(ServiceKey)
  1035.     else
  1036.         ;
  1037.         ; Error, cannot open network card key
  1038.         ;
  1039.         goto fatalregistry
  1040.     endif
  1041.     endif
  1042.  
  1043.     goto end
  1044.     ;
  1045.     ; End of Upgrade Software
  1046.     ;
  1047.  
  1048. ;
  1049. ;  Escape hatches
  1050. ;
  1051. successful = +
  1052.     goto end
  1053.  
  1054. abandon = +
  1055.     ForListDo $(OEM_ABANDON_OPTIONS)
  1056.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1057.         $(ProductSoftwareName), $($)
  1058.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1059.         Debug-Output "ShellCode error"
  1060.         goto ShellCodeError
  1061.     endif
  1062.  
  1063.     set RegistryErrorIndex = $($R0)
  1064.  
  1065.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1066.         goto fatalregistry
  1067.     endif
  1068.     EndForListDo
  1069.  
  1070.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1071.     ; Remove Software Component
  1072.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1073.         $(ProductSoftwareName), FALSE
  1074.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1075.         Debug-Output "ShellCode error"
  1076.         goto ShellCodeError
  1077.     endif
  1078.  
  1079.     set RegistryErrorIndex = $($R0)
  1080.  
  1081.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1082.         goto fatalregistry
  1083.     endif
  1084.     endif
  1085.  
  1086.     goto end
  1087.  
  1088. ;
  1089. ; warning display
  1090. ;
  1091. warning = +
  1092.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1093.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1094.     goto ShellCodeError
  1095.     endif
  1096.     ifstr(i) $($R1) == "OK"
  1097.     goto $(to)
  1098.     else-ifstr(i) $($R1) == "CANCEL"
  1099.     goto $(from)
  1100.     else
  1101.     goto "end"
  1102.     endif
  1103. ;
  1104. ; non fatal error display
  1105. ;
  1106. nonfatalinfo = +
  1107.     Set Severity = STATUS
  1108.     Set CommonStatus = STATUS_USERCANCEL
  1109.     goto nonfatalmsg
  1110. nonfatal = +
  1111.     Set Severity = NONFATAL
  1112.     goto nonfatalmsg
  1113. nonfatalmsg = +
  1114.     ifstr(i) $(Error) == ""
  1115.     Set Severity = NONFATAL
  1116.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1117.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1118.         goto ShellCodeError
  1119.     endif
  1120.     set Error = $($R0)
  1121.     endif
  1122.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1123.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1124.     goto ShellCodeError
  1125.     endif
  1126.     ifstr(i) $($R1) == "OK"
  1127.     goto $(from)
  1128.     else
  1129.     goto "end"
  1130.     endif
  1131.  
  1132. ;
  1133. ;  Registry is broken
  1134. ;
  1135. fatalregistry = +
  1136.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1137.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1138.     goto ShellCodeError
  1139.     endif
  1140.     set Error = $($R0)
  1141.     goto fatal
  1142. ;
  1143. ;  Netcard detection failure
  1144. ;
  1145. fataldetect = +
  1146.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1147.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1148.     Debug-Output "ShellCode error: cannot get an error string."
  1149.     goto ShellCodeError
  1150.     endif
  1151.     set Error = $($R0)
  1152.     Goto fatal
  1153. ;
  1154. ; fatal error display
  1155. ;
  1156. fatal = +
  1157.     ifstr(i) $(Error) == ""
  1158.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1159.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1160.         goto ShellCodeError
  1161.     endif
  1162.     set Error = $($R0)
  1163.     endif
  1164.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1165.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1166.     goto ShellCodeError
  1167.     endif
  1168.  
  1169.     goto setfailed
  1170.  
  1171. ;
  1172. ;  Shelling error
  1173. ;
  1174. ShellCodeError = +
  1175.     set DlgType      = "MessageBox"
  1176.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1177.     set STF_MB_TEXT  = $(ShellCodeErrorText) 
  1178.     set STF_MB_TYPE  = 1
  1179.     set STF_MB_ICON  = 3
  1180.     set STF_MB_DEF   = 1
  1181.     ui start "Error Message"
  1182.     goto setfailed
  1183.  
  1184. setfailed = +
  1185.     set CommonStatus = STATUS_FAILED
  1186.     ;
  1187.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1188.     ;
  1189.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1190.     set OEM_ABANDON_ON = FALSE
  1191.     goto abandon
  1192.     endif
  1193.     goto end
  1194.  
  1195. end = +
  1196.     goto term
  1197.  
  1198. term = +
  1199.  
  1200.     Return $(CommonStatus)
  1201.  
  1202. [DebugConfiguration]
  1203.  
  1204.     Set InfName = "OEMSETNT.INF"
  1205.     ;Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1206.     ;Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1207.     ;Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1208.     ;Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1209.     ;Debug-Output $(InfName)" MemoryAddr is "$(!p:MemoryAddr)
  1210.     ;Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  1211.  
  1212.     return
  1213.  
  1214.  
  1215. ;***************************************************************
  1216. ;  INSTALL SECTIONS
  1217. ;***************************************************************
  1218. [Install-Option]
  1219.     set STF_VITAL = ""
  1220.  
  1221.     ifstr(i) $(AddCopy) == "YES"
  1222.  
  1223.     ;
  1224.     ; Add the files to the copy list
  1225.     ;
  1226.     ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1227.     ;      the other INF files
  1228.     ;
  1229.     AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1230.  
  1231.     endif
  1232.  
  1233.     ifstr(i) $(DoCopy) == "YES"
  1234.  
  1235.        ;
  1236.        ; Copy files in the copy list
  1237.        ;
  1238.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1239.        CopyFilesInCopyList
  1240.  
  1241.     endif
  1242.  
  1243.     Exit
  1244.  
  1245. [Install-Update]
  1246.    set STF_VITAL        = ""
  1247.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1248.    ;set STF_VERSION     = "YES"
  1249.  
  1250.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1251.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1252.  
  1253.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1254.    CopyFilesInCopyList
  1255.  
  1256.    exit
  1257.  
  1258.  
  1259. [Install-Dll]
  1260.    set STF_VITAL        = ""
  1261.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1262.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1263.    CopyFilesInCopyList
  1264.    exit
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270. [Source Media Descriptions]
  1271.     1  = "Xircom Setup Disk for NT" 
  1272.  
  1273. [Signature]
  1274.     FileType = MICROSOFT_DRVLIB_FILE
  1275. [GetSignature]
  1276.     read-syms Signature
  1277.     return $(FileType)
  1278.  
  1279. [ProductType]
  1280. STF_PRODUCT  = Winnt
  1281. STF_PLATFORM = I386
  1282.  
  1283.  
  1284. [Files-Inf]
  1285. 1, OEMSETNT.INF, SIZE=43500,    RENAME=$(!UG_Filename)
  1286.  
  1287. [Files-Dll]
  1288. 1, XIRCOM.DLL,  SIZE=9728
  1289.  
  1290. [Files-CENDIS3]
  1291. 1, CENDIS3.SYS, SIZE=43008
  1292.  
  1293.  
  1294. [LanguagesSupported]
  1295.     ENG
  1296.  
  1297. [AllFileConstantsENG]
  1298. ProCaption   = "Windows NT Setup"
  1299. ProCancel    = "Cancel"
  1300. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  1301.            "Are you sure you want to cancel copying files?"
  1302. ProCancelCap = "Network Setup Message"
  1303. ProText1     = "Copying:"
  1304. ProText2     = "To:"
  1305. DialogDllName     = "XIRCOM.DLL"
  1306.  
  1307.  
  1308. ; CE/A ---------------------------------------------------------------------------------------
  1309. [FileConstantsENG-CENDIS3]
  1310. FunctionTitle   = $(GenericAdapterName)" Setup"$(GenericInfVersion)
  1311. ProductSoftwareTitle        = $(GenericDriverName)
  1312. ProductHardwareCENDIS3Title = $(GenericAdapterName)
  1313. ProductHardwareTitle        = $(GenericAdapterName)
  1314. IRQList           = ^(IRQChoices, 1)
  1315. IRQValues         = ^(IRQChoices, 2)
  1316. IOBaseAddrList    = ^(IOBaseAddrChoices, 1)     
  1317. IOBaseAddrValues  = ^(IOBaseAddrChoices, 2)
  1318. MemoryAddrList    = ^(MemoryAddrChoices,1)
  1319. MemoryAddrValues  = ^(MemoryAddrChoices,2)
  1320. TransceiverList   = ^(TransceiverChoices,1)
  1321. TransceiverValues = ^(TransceiverChoices,2)
  1322.  
  1323.  
  1324. [DialogConstantsENG-CENDIS3]
  1325. Help        = "&Help"
  1326. Exit        = "Cancel"
  1327. OK          = "OK"
  1328. HelpContext = ""
  1329. Continue    = "Continue"
  1330. Cancel      = "Cancel"
  1331. ;CardInfo    = "Card Info"
  1332.  
  1333.  
  1334. [FileDependentDlgENG-CENDIS3]
  1335. DlgType = "RadioCombination"
  1336. DlgTemplate = "CEA"
  1337. Caption = $(FunctionTitle)
  1338. HelpContext = $(!IDH_DB_OEMNADE2_INS)
  1339. CBOptionsGreyed = {}
  1340. NotifyFields = {NO, NO, NO, NO}
  1341. Combo1Label = "I/&O Port Address:"                  
  1342. Combo2Label = "&Memory Address:"
  1343. Combo3Label = "&Interrupt:"
  1344. Combo4Label = "&Transceiver Type:"
  1345. ;---------------------------
  1346. Combo1List = $(IOBaseAddrList)
  1347. Combo1Out  = $(IOBaseAddrValue)
  1348. Combo2List = $(MemoryAddrList)
  1349. Combo2Out  = $(MemoryAddrValue)
  1350. Combo3List = $(IRQList)
  1351. Combo3Out  = $(IRQValue)
  1352. Combo4List = $(TransceiverList)
  1353. Combo4Out  = $(TransceiverValue)
  1354. ;---------------------------
  1355. ComboListItemsIn  = {Combo1List,Combo2List,Combo3List, Combo4List}
  1356. ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out}
  1357. EditTextIn = {"", ""}
  1358. EditTextLim = {"",""}
  1359. ; END CE/A ---------------------------------------------------------------------------------------
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365. [MemoryAddrChoices]
  1366. MA_1  = "0xA0000", 655360
  1367. MA_2  = "0xA1000", 659456
  1368. MA_3  = "0xA2000", 663552
  1369. MA_4  = "0xA3000", 667648
  1370. MA_5  = "0xA4000", 671744
  1371. MA_6  = "0xA5000", 675840
  1372. MA_7  = "0xA6000", 679936
  1373. MA_8  = "0xA7000", 684032
  1374. MA_9  = "0xA8000", 688128
  1375. MA_10 = "0xA9000", 692224
  1376. MA_11 = "0xAA000", 696320
  1377. MA_12 = "0xAB000", 700416
  1378. MA_13 = "0xAC000", 704512
  1379. MA_14 = "0xAD000", 708608
  1380. MA_15 = "0xAE000", 712704
  1381. MA_16 = "0xAF000", 716800
  1382. MA_17 = "0xB0000", 720896
  1383. MA_18 = "0xB1000", 724992
  1384. MA_19 = "0xB2000", 729088
  1385. MA_20 = "0xB3000", 733184
  1386. MA_21 = "0xB4000", 737280
  1387. MA_22 = "0xB5000", 741376
  1388. MA_23 = "0xB6000", 745472
  1389. MA_24 = "0xB7000", 749568
  1390. MA_25 = "0xB8000", 753664
  1391. MA_26 = "0xB9000", 757760
  1392. MA_27 = "0xBA000", 761856
  1393. MA_28 = "0xBB000", 765952
  1394. MA_29 = "0xBC000", 770048
  1395. MA_30 = "0xBD000", 774144
  1396. MA_31 = "0xBE000", 778240
  1397. MA_32 = "0xBF000", 782336
  1398. MA_33 = "0xC0000", 786432
  1399. MA_34 = "0xC1000", 790528
  1400. MA_35 = "0xC2000", 794624
  1401. MA_36 = "0xC3000", 798720
  1402. MA_37 = "0xC4000", 802816
  1403. MA_38 = "0xC5000", 806912
  1404. MA_39 = "0xC6000", 811008
  1405. MA_40 = "0xC7000", 815104
  1406. MA_41 = "0xC8000", 819200
  1407. MA_42 = "0xC9000", 823296
  1408. MA_43 = "0xCA000", 827392
  1409. MA_44 = "0xCB000", 831488
  1410. MA_45 = "0xCC000", 835584
  1411. MA_46 = "0xCD000", 839680
  1412. MA_47 = "0xCE000", 843776
  1413. MA_48 = "0xCF000", 847872
  1414. MA_49 = "0xD0000", 851968
  1415. MA_50 = "0xD1000", 856064
  1416. MA_51 = "0xD2000", 860160
  1417. MA_52 = "0xD3000", 864256
  1418. MA_53 = "0xD4000", 868352
  1419. MA_54 = "0xD5000", 872448
  1420. MA_55 = "0xD6000", 876544
  1421. MA_56 = "0xD7000", 880640
  1422. MA_57 = "0xD8000", 884736
  1423. MA_58 = "0xD9000", 888832
  1424. MA_59 = "0xDA000", 892928
  1425. MA_60 = "0xDB000", 897024
  1426. MA_61 = "0xDC000", 901120
  1427. MA_62 = "0xDD000", 905216
  1428. MA_63 = "0xDE000", 909312
  1429. MA_64 = "0xDF000", 913408
  1430. MA_65 = "0xE0000", 917504
  1431. MA_66 = "0xE1000", 921600
  1432. MA_67 = "0xE2000", 925696
  1433. MA_68 = "0xE3000", 929792
  1434. MA_69 = "0xE4000", 933888
  1435. MA_70 = "0xE5000", 937984
  1436. MA_71 = "0xE6000", 942080
  1437. MA_72 = "0xE7000", 946176
  1438. MA_73 = "0xE8000", 950272
  1439. MA_74 = "0xE9000", 954368
  1440. MA_75 = "0xEA000", 958464
  1441. MA_76 = "0xEB000", 962560
  1442. MA_77 = "0xEC000", 966656
  1443. MA_78 = "0xED000", 970752
  1444. MA_79 = "0xEE000", 974848
  1445. MA_80 = "0xEF000", 978944
  1446. MA_81 = "0xF0000", 983040
  1447. MA_82 = "0xF1000", 987136
  1448. MA_83 = "0xF2000", 991232
  1449. MA_84 = "0xF3000", 995328
  1450. MA_85 = "0xF4000", 999424
  1451. MA_86 = "0xF5000", 1003520
  1452. MA_87 = "0xF6000", 1007616
  1453. MA_88 = "0xF7000", 1011712
  1454. MA_89 = "0xF8000", 1015808
  1455. MA_90 = "0xF9000", 1019904
  1456. MA_91 = "0xFA000", 1024000
  1457. MA_92 = "0xFB000", 1028096
  1458. MA_93 = "0xFC000", 1032192
  1459. MA_94 = "0xFD000", 1036288
  1460. MA_95 = "0xFE000", 1040384
  1461.  
  1462. [TransceiverChoices]
  1463. TR_1 = "Twisted Pair (10bT)", 0
  1464. TR_2 = "Thin Net (10b2 BNC/COAX)", 1
  1465.  
  1466. [IRQChoices]
  1467. ;Interrupts available on the PCIC: { 3,4,5,7,8,10,11,12,14,15 }
  1468. ;Interrupts available on the TCIC: { 3,4,5,6,7,10,14 }
  1469. ;14 = fixed disk
  1470. ;12 = keyboard
  1471. ;6  = floppy disk
  1472. ;union(PCIC, TCIC) - {14} = 3,4,5,7,10
  1473. IRQ_1 = "3",3
  1474. IRQ_2 = "4",4
  1475. IRQ_3 = "5",5
  1476. IRQ_4 = "7",7
  1477. IRQ_5 = "10",10
  1478. IRQ_6 = "11",11
  1479. IRQ_7 = "15",15
  1480.  
  1481.      
  1482.      
  1483. [CableTypeChoices]
  1484. CT_1 = "Auto Detect", 0
  1485. CT_2 = "Twisted Pair (10bT)", 1
  1486. CT_3 = "Thin Net (10b2 BNC/COAX)", 2
  1487.  
  1488.  
  1489. [IOBaseAddrChoices]
  1490. ; 0x3E0 is where PCIC is located
  1491. ; 0x240 is where TCIC is located
  1492. ; therefore user cannot select these for locating the ethernet adapter
  1493. IOBase_1  = "0x110",272
  1494. IOBase_1  = "0x200",512
  1495. IOBase_2  = "0x210",528
  1496. IOBase_3  = "0x220",544
  1497. IOBase_4  = "0x230",560
  1498. ;IOBase_5  = "0x240",576
  1499. IOBase_6  = "0x250",592
  1500. IOBase_7  = "0x260",608
  1501. IOBase_8  = "0x270",624
  1502. IOBase_9  = "0x280",640
  1503. IOBase_10 = "0x290",656
  1504. IOBase_11 = "0x2A0",672
  1505. IOBase_12 = "0x2B0",698
  1506. IOBase_13 = "0x2C0",714
  1507. IOBase_14 = "0x2D0",730
  1508. IOBase_15 = "0x2E0",746
  1509. IOBase_16 = "0x2F0",752
  1510. IOBase_17 = "0x300",768
  1511. IOBase_18 = "0x310",784
  1512. IOBase_19 = "0x320",800
  1513. IOBase_20 = "0x330",816
  1514. IOBase_21 = "0x340",832
  1515. IOBase_22 = "0x350",848
  1516. IOBase_23 = "0x360",864
  1517. IOBase_24 = "0x370",880
  1518. IOBase_25 = "0x380",896
  1519. IOBase_26 = "0x390",912
  1520. IOBase_27 = "0x3A0",928
  1521. IOBase_28 = "0x3B0",944
  1522. IOBase_29 = "0x3C0",960
  1523. IOBase_30 = "0x3D0",976
  1524.  
  1525.  
  1526.  
  1527.